<%--
  Created by IntelliJ IDEA.
  author: Jsonor
  date: 2018/4/16 16:40
  description: Description
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="zh">

<head>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Bootstrap Login Form Template</title>

  <span style="font-family:'Microsoft YaHei';font-size:18px;"><c:set var="contextPath" value="${pageContext.request.contextPath}" scope="application"/>
    <script>
        var contextPath = "${contextPath}";
    </script>  </span>
  <!-- CSS -->
  <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/user/form-2/assets/bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/user/form-2/assets/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/user/form-2/assets/css/form-elements.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/user/form-2/assets/css/style.css">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Favicon and touch icons -->
  <link rel="shortcut icon" href="${pageContext.request.contextPath}/user/form-2/assets/ico/favicon.png">
  <link rel="apple-touch-icon-precomposed" sizes="144x144"
        href="${pageContext.request.contextPath}/user/form-2/assets/ico/apple-touch-icon-144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114"
        href="${pageContext.request.contextPath}/user/form-2/assets/ico/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72"
        href="${pageContext.request.contextPath}/user/form-2/assets/ico/apple-touch-icon-72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="${pageContext.request.contextPath}/user/form-2/assets/ico/apple-touch-icon-57-precomposed.png">

</head>

<body>

<!-- Top content -->
<div class="top-content">

  <div class="inner-bg">
    <div class="container">
      <div class="row">
        <div class="col-sm-8 col-sm-offset-2 text">
          <h1><strong>User</strong> Login Form</h1>
          <div class="description">
            <p>
              用户注册
            </p>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-6 col-sm-offset-3 form-box">
          <div class="form-top">
            <div class="form-top-left">
              <h3>Login to our site</h3>
              <p>Enter your username and password to log on:</p>
            </div>
            <div class="form-top-right">
              <i class="fa fa-lock"></i>
            </div>
          </div>
          <div class="form-bottom">
            <form role="form" action="/user/register.do" method="post" class="register-form">
              <br/>
              <div border-top="10px" id="tips" style="text-align: center;position:absolute;border-top: 10px;float: right;display:none;margin-outside: 5px">
              </div>
              <h5 style="color:red;">${msg}</h5>
              <div class="form-group">
                <%--<label class="sr-only" for="form-username">Username</label>--%>
                <input required="required" type="text" name="username" placeholder="Username..."
                          class="form-username form-control" id="username" onfocus="tips('username','姓名长度最多16个字符')" onblur="outtips()">

                  </div>


              <div class="form-group">
                <%--<label class="sr-only" for="form-password">Password</label>--%>
                <input type="password" required="required" name="password" placeholder="Password..."
                       class="form-password form-control" id="password" onfocus="tips('password','密码必填')" onblur="outtips()">
              </div>
              <div class="form-group">
                <%--<label class="sr-only" for="form-password">Password</label>--%>
                <input type="text" name="email" placeholder="email..."
                       class="form-password form-control" onchange="check()" id="email" onfocus="tips('email','邮箱格式需正确')" onblur="outtips()">
              </div>
              <div class="form-group">
                <%--<label class="sr-only" for="form-password">Password</label>--%>
                <input type="text" name="phone" placeholder="phone..."
                       class="form-password form-control" id="phone" >
              </div>
              <div class="form-group">
                <%--<label class="sr-only" for="form-password">Password</label>--%>
                <input type="text" required="required" name="question"
                       placeholder="Secret Question..." class="form-password form-control" id="">
              </div>
              <div class="form-group">
                <%--<label class="sr-only" for="form-password">Password</label>--%>
                <input type="text" required="required" name="answer" placeholder="Secret Answer..."
                       class="form-password form-control">
              </div>
              <button type="submit"  class="btn">submit!</button>
            </form>
          </div>
        </div>
      </div>

    </div>
  </div>

</div>


<!-- Javascript -->
<script src="assets/js/jquery-1.11.1.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/jquery.backstretch.min.js"></script>
<script src="assets/js/scripts.js"></script>
<script language="javascript">


  function check() {

    var email = document.getElementById("email").value;

//
    if (email == "") {
      alert("电子邮件不能为空");
      return false;
    }
    else {
      reg = /^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/gi;
      if (!reg.test(email)) {
        alert("非法的电子邮件，邮件格式为XXXX@XX.xxx");
        return false;
      }
    }
  }
</script>
<script language="javascript">
  function tips(id, str) {
    var l = document.getElementById(id).offsetLeft + 120;
    var t = document.getElementById(id).offsetTop;
    document.getElementById("tips").innerHTML = "提示：" + str;
    document.getElementById("tips").style.left = l + "px";
    document.getElementById("tips").style.top = t + "px";
    document.getElementById("tips").style.display = "";
  }

  function outtips() {
    document.getElementById("tips").style.display = 'none';
  }
</script>


<!--[if lt IE 10]>
<script src="assets/js/placeholder.js"></script>
<![endif]-->

</body>

</html>
